import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/components/special_operation/map/selected_location/selected_location_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:get/get.dart';

/// 计划作业地点选取
class SelectedLocationWidget extends StatelessWidget {
  SelectedLocationWidget({super.key});

  final controller = Get.put(SelectedLocationController());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CustomAppBar(
        titleText: '地点选取',
      ),
      body: Stack(
        children: [
          InAppWebView(
            initialUrlRequest: controller.url,
            // initialFile: 'assets/html/test-onlyPlot.html',
            onWebViewCreated: controller.onWebViewCreated,
          ),
          Row(
            children: [
              Container(
                width: 140,
                margin: const EdgeInsets.only(top: 10, left: 13),
                padding: const EdgeInsets.only(left: 10),
                decoration: BoxDecoration(
                  color: const Color(0x8A122041),
                  borderRadius: BorderRadius.circular(6),
                ),
                child: TextField(
                  style: const TextStyle(
                    fontSize: 14,
                    color: Color(0xffffffff),
                  ),
                  decoration: const InputDecoration(
                    hintText: '请输入地点名称',
                    border: InputBorder.none,
                    hintStyle: TextStyle(
                      fontSize: 14,
                      color: Color(0xffffffff),
                    ),
                  ),
                  onChanged: (value) {
                    controller.ticketAddress = value;
                  },
                ),
              ),
            ],
          ),
        ],
      ),
    );
  }
}
